const app = getApp()
var login = require('../../actions/login.js');

Page({
  /**
   * 页面的初始数据
   */
  data: {
    region: ['江苏省', '南通市', '启东市'],
    customItem: '全部'
  },


  bindRegionChange: function(e) {
    console.log('picker发送选择改变，携带值为', e.detail.value)
    this.setData({
      region: e.detail.value
    })
  },

  login: function(e) {
    app.globalData.userInfo = e.detail.userInfo
    this.setData({
      hasUserInfo: true
    });

    let province = this.data.region[0];
    let county = this.data.region[2];
    let city = this.data.region[1];

    login.lmmLogin((res) => {
      app.globalData.user = res;
    }, app.globalData.shopId, e.detail.userInfo, province ,  city , county ).then(()=>{
      wx.navigateBack({});
    });
  }

})